home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / util / cdity / Yak210src.lha / Yak_2.10_Src / Requesters.c < prev    next >
C/C++ Source or Header  |  1995-03-21  |  1KB  |  77 lines

  1. #define __USE_SYSBASE 
  2.  
  3. #include <exec/types.h>
  4. #include <intuition/intuitionbase.h>
  5. #include <stdarg.h>
  6.  
  7. #include <proto/dos.h>
  8. #include <proto/exec.h>
  9. #include <proto/intuition.h>
  10.  
  11. #include "Code.h"
  12. #include "Requesters.h"
  13.  
  14. #ifdef PREFS
  15. #  define REQUESTER_TITLE "Yak-Prefs"
  16. #else
  17. #  define REQUESTER_TITLE "Yak"
  18. #endif
  19.  
  20. /* simple requesters with args */
  21. void
  22. PostError(char *body, ... )
  23. {
  24.     struct EasyStruct es;
  25.     va_list args;
  26.  
  27.     if (!IntuitionBase)
  28.     {
  29.         Write(Output(), "Need AmigaDos 2.0+\n", -1);
  30.         return;
  31.     }
  32.  
  33.     /* setup the argument array */
  34.     va_start( args, body );
  35.  
  36.     /* initialise the structure */
  37.     es.es_StructSize = sizeof(struct EasyStruct);
  38.     es.es_Flags = 0L;
  39.     es.es_Title = REQUESTER_TITLE;
  40.     es.es_TextFormat = body;
  41.     es.es_GadgetFormat = "OK";
  42.  
  43.     /* display the requester */
  44.     EasyRequestArgs(NULL, &es, NULL, args);
  45.  
  46.     /* free the arguments */
  47.     va_end( args );
  48. }
  49.  
  50.  
  51. LONG
  52. GetOrders(char *gadtext, char *body, ... )
  53. {
  54.     struct EasyStruct es;
  55.     LONG rc;
  56.     va_list args;
  57.  
  58.     /* setup the argument array */
  59.     va_start( args, body );
  60.  
  61.     /* initialise the structure */
  62.     es.es_StructSize = sizeof(struct EasyStruct);
  63.     es.es_Flags = 0L;
  64.     es.es_Title = REQUESTER_TITLE;
  65.     es.es_TextFormat = body;
  66.     es.es_GadgetFormat = gadtext;
  67.  
  68.     /* display the requester */
  69.     rc = EasyRequestArgs(NULL, &es, NULL, args);
  70.  
  71.     /* free the arguments */
  72.     va_end( args );
  73.  
  74.     return rc;
  75. }
  76.  
  77.